package com.saris.primego.dao;

import com.saris.primego.pojo.entity.ShoppingCart;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

@Repository
public interface ShoppingCartRepository extends JpaRepository<ShoppingCart, Long> {

    void deleteByUserId(Long userId);

    List<ShoppingCart> getAllByUserIdAndDishId(Long userId, Long dishId);

    List<ShoppingCart> getAllByUserIdAndSetmealId(Long userId, Long setmealId);

    Optional<List<ShoppingCart>> findAllByUserId(Long userId);
}
